<?php 

Class contentController extends appController
{
	
	public function index()
	{
		$page=isset($_REQUEST['page'])?intval($_REQUEST['page']):1;
		$menu_list=Model('menu')->get_menu_list2($page,10,0);
		
		$this->assign('ur_here','>内容管理');
		$this->assign('menu_list',$menu_list['data']);
		$this->assign('menu_page',$menu_list['pagelink']);
		
		
		$this->display('menu_list.html');
		
	}
	public function create()
	{
		$id=$_REQUEST['id'];
		$art=Model('content')->get_content_info($id);
		if($art)
		{
	
			$saveDir=HTML_PATH.'/'.$art['code'];
			$activePage="http://".$_SERVER['HTTP_HOST']."/index.php?g=home&m=content&a=index&id=$id";
	
			$fileName='index';
	
			$this->create_html($activePage,$fileName,$saveDir);
		}
	}
	public function add_content()
	{
		$id=isset($_REQUEST['id'])?intval($_REQUEST['id']):'';
		$class_name=Model('content')->type_route($id);
		if($class_name)
		{
			header('Location:/index.php?g=admin&m='.$class_name.'&a=index&id='.$id);
		  //  Ctrl($class_name)->index($id);
		}
	}

	
	
}